package com.jia.interviewPro;

/**
 * @program: Leetcode
 * @description: https://leetcode-cn.com/problems/missing-number-lcci/
 * @author: STU756
 * @create: 2020-09-03 14:15
 */
public class Pro1704 {
    public int missingNumber(int[] nums) {
        int ans = 0;
        for(int num : nums) {
            ans^=num;
        }
        for(int i = 0; i <= nums.length; i++) {
            ans ^= i;
        }
        return ans;
    }
}
